package com.gls.security.server.authorization.jpa.entity;

import com.gls.starter.data.jpa.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import java.util.Set;

/**
 * 客户端信息表
 *
 * @author lizhiyong
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
public class Client extends BaseEntity {

    private String clientId;

    private String clientSecret;

    @ElementCollection
    private Set<String> scope;

    @ElementCollection
    private Set<String> resourceIds;

    @ElementCollection
    private Set<String> authorizedGrantTypes;

    @ElementCollection
    private Set<String> registeredRedirectUris;

    @ElementCollection
    private Set<String> autoApproveScopes;

    private Integer accessTokenValiditySeconds;

    private Integer refreshTokenValiditySeconds;

}
